import { Module } from "@nestjs/common";
import { PrismaService } from '../prisma/prisma.service';
import { PrismaModule } from '../prisma/prisma.module';
import { PrismaRepository } from "@/examples/user/repositories/prisma.repository";
import { PRISMA_DATABASE } from "../database.constants";

@Module({
    imports: [
        // 自定义PrismaModule注册连接数据库
        PrismaModule.forRootAsync({
            name: PRISMA_DATABASE,
            useClass: PrismaService
        }),
        /* PrismaModule.forRoot({
          url: 'mysql://root:123456@127.0.0.1:3306/testdb',
          name: 'prisma1'
        }), */
    ],
    providers: [PrismaRepository],
    exports: [PrismaService, PrismaRepository]
})
export class PrismaCommonModule {

}